package com.rockcent.mall.lib.domain;

import javax.persistence.*;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.enumclass.MallAuditCertifyInfoStatusType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import java.util.Date;

/**
 * Created by oyhk on 16/7/15.
 */
@Entity
@Table(name = "mall")
@DynamicInsert
@DynamicUpdate
public class Mall extends IDEntityMall {

    @Column(columnDefinition = "varchar(200) comment '平台名称'")
    private String name;
    @Column(columnDefinition = "varchar(200) comment '配置的域名地址'")
    private String hostname;
    @Column(columnDefinition = "bigint comment '用户id'", name = "account_id")
    private Long userInfoId;
    @Column(columnDefinition = "varchar(50) comment '公司名称'")
    private String companyName;
    @Column(columnDefinition = "varchar(50) comment '分销码'")
    private String salesCode;
    @Column(columnDefinition = "varchar(50) comment '手机端域名'")
    private String mobileHostName;
    @Column(columnDefinition = "bit comment '是否产品审核'")
    private Boolean prodAudit = false;
    @Column(columnDefinition = "varchar(50) comment '自定义B端域名'",unique = true)
    private String customerBusinessDomain;
    @Column(columnDefinition = "varchar(50) comment '自定义M端域名'",unique = true)
    private String customerPlatformDomain;
    @Column(columnDefinition = "varchar(50) comment '自定义C端域名'",unique = true)
    private String customerClientDomain;
    @Column(columnDefinition = "varchar(50) comment '自定义一级域名'",unique = true)
    private String customerDomain;
    @Column(columnDefinition = "varchar (20) comment '是否开通权限 (是:YES,否:NO)'")
    @Enumerated(EnumType.STRING)
    private Whether isLogisticsAccess = Whether.YES;
    @Column(columnDefinition = "varchar (20) comment '是否通过审核验证 (是:YES,否:NO)'")
    @Enumerated(EnumType.STRING)
    private Whether auditValidate = Whether.NO;
    @Column(columnDefinition = "varchar (20) comment '自定义域名是否通过审核验证 (是:YES,否:NO)'")
    @Enumerated(EnumType.STRING)
    private Whether openCustomDomain = Whether.NO;

    @Column(columnDefinition = "varchar(200) comment '广告图'")
    private String backgroundPicture;
    @Column(columnDefinition = "varchar(200) comment '平台大LOGO'")
    private String logoBigPicture;
    @Column(columnDefinition = "varchar(200) comment '平台小LOGO'")
    private String logoSmallPicture;
    @Column(columnDefinition = "varchar(150) comment '平台标签'")
    private String tag;
    @Column(columnDefinition = "MEDIUMTEXT comment '平台介绍'")
    private String introduce;
    @Column(columnDefinition = "varchar(100) comment '平台关键词'")
    private String keyword;
    @Column(columnDefinition = "varchar(30) comment '客服邮箱'")
    private String serviceEmail;
    @Column(columnDefinition = "varchar(18) comment '客服电话'")
    private String serviceTelephone;
    @Column(columnDefinition = "varchar(15) comment '在线QQ'")
    private String onlineQq;
    @Column(columnDefinition = "text comment '平台二维码'")
    private String QRCodeUrl;
    @Column(columnDefinition = "bigint comment '平台资金账户ID'")
    private Long mallFundId;
    @Column(columnDefinition = "varchar(120) comment 'ICP备案号'")
    private String icpNumber;
    @Column(columnDefinition = "varchar (20) comment ' 平台资质信息是否审核 (ALL(\"全部\"), UN_AUDIT(\"未认证\"), AUDIT(\"审核中\"), AUDIT_PASS(\"审核通过\"), NOT_AUDIT(\"审核不通过\"))'")
    @Enumerated(EnumType.STRING)
    private MallAuditCertifyInfoStatusType auditCertifyInfoStatus = MallAuditCertifyInfoStatusType.UN_AUDIT;
    @Column(columnDefinition = "varchar(255) comment '审核平台资质信息意见'")
    private String auditCertifyInfoRemark;
    @Column(columnDefinition = "datetime comment '审核时间'")
    private Date dateAudited;

    public static final String DEFAULT_SERVER_RATE = "2.5";
    public static final String DEFAULT_SHARE_RATE = "50";


    public static final String CHECK_NAME_IS_NOT_NULL = "平台名称不能为空";
    public static final String CHECK_HOSTNAME_IS_NOT_NULL = "域名不能为空";
    public static final String CHECK_COMPANY_NAME_IS_NOT_NULL = "公司名称不能为空";
    public static final String CHECK_CONTACT_IS_NOT_NULL = "联系人不能为空";
    public static final String CHECK_MOBILE_IS_NOT_NULL = "手机号不能为空";

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getHostname() {
        return hostname;
    }

    public void setHostname(String hostname) {
        this.hostname = hostname;
    }

    public Long getUserInfoId() {
        return userInfoId;
    }

    public void setUserInfoId(Long userInfoId) {
        this.userInfoId = userInfoId;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getSalesCode() {
        return salesCode;
    }

    public void setSalesCode(String salesCode) {
        this.salesCode = salesCode;
    }

    public String getMobileHostName() {
        return mobileHostName;
    }

    public void setMobileHostName(String mobileHostName) {
        this.mobileHostName = mobileHostName;
    }

    public Boolean getProdAudit() {
        return prodAudit;
    }

    public void setProdAudit(Boolean prodAudit) {
        this.prodAudit = prodAudit;
    }

    public String getCustomerBusinessDomain() {
        return customerBusinessDomain;
    }

    public void setCustomerBusinessDomain(String customerBusinessDomain) {
        this.customerBusinessDomain = customerBusinessDomain;
    }

    public String getCustomerPlatformDomain() {
        return customerPlatformDomain;
    }

    public void setCustomerPlatformDomain(String customerPlatformDomain) {
        this.customerPlatformDomain = customerPlatformDomain;
    }

    public String getCustomerClientDomain() {
        return customerClientDomain;
    }

    public void setCustomerClientDomain(String customerClientDomain) {
        this.customerClientDomain = customerClientDomain;
    }

    public String getCustomerDomain() {
        return customerDomain;
    }

    public void setCustomerDomain(String customerDomain) {
        this.customerDomain = customerDomain;
    }

    public Whether getIsLogisticsAccess() {
        return isLogisticsAccess;
    }

    public void setIsLogisticsAccess(Whether isLogisticsAccess) {
        this.isLogisticsAccess = isLogisticsAccess;
    }

    public String getBackgroundPicture() {
        return backgroundPicture;
    }

    public void setBackgroundPicture(String backgroundPicture) {
        this.backgroundPicture = backgroundPicture;
    }

    public String getLogoBigPicture() {
        return logoBigPicture;
    }

    public void setLogoBigPicture(String logoBigPicture) {
        this.logoBigPicture = logoBigPicture;
    }

    public String getLogoSmallPicture() {
        return logoSmallPicture;
    }

    public void setLogoSmallPicture(String logoSmallPicture) {
        this.logoSmallPicture = logoSmallPicture;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getIntroduce() {
        return introduce;
    }

    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public String getServiceEmail() {
        return serviceEmail;
    }

    public void setServiceEmail(String serviceEmail) {
        this.serviceEmail = serviceEmail;
    }

    public String getServiceTelephone() {
        return serviceTelephone;
    }

    public void setServiceTelephone(String serviceTelephone) {
        this.serviceTelephone = serviceTelephone;
    }

    public String getOnlineQq() {
        return onlineQq;
    }

    public String getQRCodeUrl() {
        return QRCodeUrl;
    }

    public void setQRCodeUrl(String QRCodeUrl) {
        this.QRCodeUrl = QRCodeUrl;
    }

    public void setOnlineQq(String onlineQq) {
        this.onlineQq = onlineQq;
    }

    public Whether getAuditValidate() {
        return auditValidate;
    }

    public void setAuditValidate(Whether auditValidate) {
        this.auditValidate = auditValidate;
    }

    public Whether getOpenCustomDomain() {
        return openCustomDomain;
    }

    public void setOpenCustomDomain(Whether openCustomDomain) {
        this.openCustomDomain = openCustomDomain;
    }

    public Long getMallFundId() {
        return mallFundId;
    }

    public void setMallFundId(Long mallFundId) {
        this.mallFundId = mallFundId;
    }

    public String getIcpNumber() {
        return icpNumber;
    }

    public void setIcpNumber(String icpNumber) {
        this.icpNumber = icpNumber;
    }

    public MallAuditCertifyInfoStatusType getAuditCertifyInfoStatus() {
        return auditCertifyInfoStatus;
    }

    public void setAuditCertifyInfoStatus(MallAuditCertifyInfoStatusType auditCertifyInfoStatus) {
        this.auditCertifyInfoStatus = auditCertifyInfoStatus;
    }

    public String getAuditCertifyInfoRemark() {
        return auditCertifyInfoRemark;
    }

    public void setAuditCertifyInfoRemark(String auditCertifyInfoRemark) {
        this.auditCertifyInfoRemark = auditCertifyInfoRemark;
    }

    public Date getDateAudited() {
        return dateAudited;
    }

    public void setDateAudited(Date dateAudited) {
        this.dateAudited = dateAudited;
    }

    @Override
    public String toString() {
        return "Mall{" +
                "name='" + name + '\'' +
                ", hostname='" + hostname + '\'' +
                ", userInfoId=" + userInfoId +
                ", companyName='" + companyName + '\'' +
                ", salesCode='" + salesCode + '\'' +
                ", mobileHostName='" + mobileHostName + '\'' +
                ", prodAudit=" + prodAudit +
                ", customerBusinessDomain='" + customerBusinessDomain + '\'' +
                ", customerPlatformDomain='" + customerPlatformDomain + '\'' +
                ", customerClientDomain='" + customerClientDomain + '\'' +
                ", customerDomain='" + customerDomain + '\'' +
                ", isLogisticsAccess=" + isLogisticsAccess +
                ", auditValidate=" + auditValidate +
                ", openCustomDomain=" + openCustomDomain +
                ", backgroundPicture='" + backgroundPicture + '\'' +
                ", logoBigPicture='" + logoBigPicture + '\'' +
                ", logoSmallPicture='" + logoSmallPicture + '\'' +
                ", tag='" + tag + '\'' +
                ", introduce='" + introduce + '\'' +
                ", keyword='" + keyword + '\'' +
                ", serviceEmail='" + serviceEmail + '\'' +
                ", serviceTelephone='" + serviceTelephone + '\'' +
                ", onlineQq='" + onlineQq + '\'' +
                ", QRCodeUrl='" + QRCodeUrl + '\'' +
                ", auditCertifyInfoStatus=" + auditCertifyInfoStatus +
                ", auditCertifyInfoRemark='" + auditCertifyInfoRemark + '\'' +
                ", dateAudited=" + dateAudited +
                ", mallFundId=" + mallFundId +
                '}';
    }
}
